/* CalSyncUm 
 * Copyright (c) 2006,2007 Arthur van Bunningen
 * Based on L-dopa Calendar Sync, Copyright (c) 2006 Richard Stoner
 * 
 * This program is in no way affiliated with Google, Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

using System.Collections.Generic;
using System.Text;

namespace calsyncum
{
    class CalendarEvent
    {
        public CalendarEvent()
        {
            googleediturl = "";
            subject = "";
            location = "";
            description = "";
            reminderMinutesBeforeStart = 15;            
            reminderSet = true;
            busystatus = "";
            outlookid = "";
            googleid = "";
            googleediturl = "";
            author = "";
            emailaddress = "";
            category = "";
        }
        public string subject;
        public string location;
        public string description;
        //times in calendar are in universal time
        public DateTime startTime;
        public DateTime endTime;
        public int reminderMinutesBeforeStart;
        public bool reminderSet;
        public int getOutlookReminderMinutesBeforeStart()
        {
            return reminderMinutesBeforeStart;
        }
        public bool getOutlookReminderSet()
        {
            return reminderSet;
        }
        public void setOutlookReminderMinutesBeforeStart(int minutes)
        {
            reminderMinutesBeforeStart = minutes;            
        }
        public bool alldayevent;
        public static string STATUS_CANCELED = "CANCELED";
        public static string STATUS_TENTATIVE = "CANCELED";
        public static string STATUS_CONFIRMED = "CONFIRMED";

        public string busystatus;
        public Microsoft.WindowsMobile.PocketOutlook.BusyStatus getOutlookBusyStatus()
        {
            if ((busystatus == STATUS_CANCELED) ||
                (busystatus == STATUS_TENTATIVE))
            {
                return Microsoft.WindowsMobile.PocketOutlook.BusyStatus.Tentative;
            }
            return Microsoft.WindowsMobile.PocketOutlook.BusyStatus.Busy;
        }
        public void setOutlookBusyStatus(Microsoft.WindowsMobile.PocketOutlook.BusyStatus outlookstatus)
        {
            if (outlookstatus == Microsoft.WindowsMobile.PocketOutlook.BusyStatus.Tentative)
            {
                busystatus = STATUS_TENTATIVE;
                return;
            }
            //the question is, if the following is true..
            busystatus = STATUS_CONFIRMED;
        }
        public string outlookid;
        public string googleid;
        public string googleediturl;
        public string author;
        public string emailaddress;
        public DateTime updatedOnGoogle;
        public bool hasrecurrence;
        public bool isrecurrenceException;
        //Google.GData.Extensions.Recurrence
        //Google.GData.Extensions.RecurrenceException
        public string category;

        //copy parameters from one calendar event to another
        public static void copyTo(CalendarEvent fromEvent, CalendarEvent toEvent)
        {
            toEvent.alldayevent = fromEvent.alldayevent;
            toEvent.author = fromEvent.author;
            toEvent.busystatus = fromEvent.busystatus;
            toEvent.category = fromEvent.category;
            toEvent.description = fromEvent.description;
            toEvent.emailaddress = fromEvent.emailaddress;
            toEvent.endTime = fromEvent.endTime;
            toEvent.googleediturl = fromEvent.googleediturl;
            toEvent.googleid = fromEvent.googleid;
            toEvent.hasrecurrence = fromEvent.hasrecurrence;
            toEvent.location = fromEvent.location;
            toEvent.outlookid = fromEvent.outlookid;
            toEvent.reminderMinutesBeforeStart = fromEvent.reminderMinutesBeforeStart;
            toEvent.reminderSet = fromEvent.reminderSet;
            toEvent.startTime = fromEvent.startTime;
            toEvent.subject = fromEvent.subject;
            toEvent.updatedOnGoogle = fromEvent.updatedOnGoogle;
            toEvent.isrecurrenceException = fromEvent.isrecurrenceException;
        }
    }
}


